

const mysql = require('mysql')
const conn = mysql.createConnection({
  host: '172.234.4.57',
  port: '3306',
  user: 'liang',
  password: '123456',
  database: 'tedu'
});

//测试连接
// conn.connect();

let name = 'tao'

//执行SQL命令
conn.query(`select * from emp where ename = '${name}'`, (err, result) => {
  if (err) throw err;
  console.log(result)
})










